package com.tsingtree.modular.controller.view;

import com.tsingtree.base.auth.annotion.Permission;
import com.tsingtree.base.pojo.page.LayuiPageInfo;
import com.tsingtree.modular.entity.NanAppReview;
import com.tsingtree.modular.model.params.NanAppReviewParam;
import com.tsingtree.modular.service.NanAppReviewService;
import com.tsingtree.roses.core.base.controller.BaseController;
import com.tsingtree.roses.core.reqres.response.ResponseData;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 * APP评论管理控制器
 *
 * @author jagger
 * @since 2025-10-28
 */
@Controller
@RequestMapping("/nanAppReview")
public class NanAppReviewController extends BaseController {

    private String PREFIX = "/nanAppReview";

    @Autowired
    private NanAppReviewService nanAppReviewService;

    /**
     * 跳转到主页面
     *
     * @author jagger
     */
    @RequestMapping("")
    public String index() {
        return PREFIX + "/nanAppReview.html";
    }

    /**
     * 查看详情接口
     *
     * @author jagger
     */
    @RequestMapping("/detail")
    @ResponseBody
    public ResponseData detail(NanAppReviewParam nanAppReviewParam) {
        NanAppReview detail = this.nanAppReviewService.getById(nanAppReviewParam.getId());
        return ResponseData.success(detail);
    }

    /**
     * 查询列表
     *
     * @author jagger
     */
    @ResponseBody
    @Permission
    @RequestMapping("/list")
    public LayuiPageInfo list(NanAppReviewParam nanAppReviewParam) {
        return this.nanAppReviewService.findPageBySpec(nanAppReviewParam);
    }

}
